package com.rulin.asp.business.externalservice.controller;

import java.util.List;

import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.rulin.asp.business.externalservice.entity.QueryParam;
import com.rulin.asp.business.externalservice.entity.QuesResult;
import com.rulin.asp.business.externalservice.service.ExternalService;
import com.rulin.asp.util.Tools;

@Controller
@RequestMapping("/external")
public class ExternalController {

	@Autowired
	private ExternalService externalService;
	
	/**
	 * 分页查询以获取奖励的图书纠错信息
	 * @param param
	 * @return
	 */
	@RequestMapping(value = "/errorQuery/getList.json", method = RequestMethod.GET)
	@ResponseBody
	public String list(QueryParam param){
		Pair<Integer, List<QuesResult>> pair = externalService.getQuesListByParam(param);
		return Tools.toEasyuiDataGrid(pair.getLeft(), pair.getRight());
	}
}
